<script setup lang="ts">
import { useUserInfoStore } from '@/store/userInfo'

const router = useRouter()
const userInfoStore = useUserInfoStore()

const url = computed(() => {
  const appid = 'wxe9e8814991929d8d'
  const redirect_uri = encodeURIComponent(`https://jzt.tykhrs.cn/api/user/official_empower?uid=${userInfoStore.userInfo!.id}`)
  return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base#wechat_redirect`
})

onLoad(() => {
  setTimeout(() => {
    router.replace('gzhQRCode')
  }, 2000)
})
</script>

<template>
  <web-view :src="url" />
</template>

<route lang="yaml">
name: 'empower'
</route>
